<template>
  <el-card>
    <template #header>
      <div class="card-header">
        <span>公告详情</span>
      </div>
    </template>
    <div v-if="announcement">
      <h3>{{ announcement.title }}</h3>
      <p>{{ announcement.content }}</p>
      <p>发布时间: {{ announcement.time }}</p>
    </div>
  </el-card>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const announcement = ref(null)

onMounted(() => {
  // 这里可以根据路由参数获取公告详情
  const id = route.params.id
  // 模拟数据，实际应该从API获取
  announcement.value = {
    id: id,
    title: `公告 ${id} 标题`,
    content: `这是公告 ${id} 的详细内容...`,
    time: '2025-05-28'
  }
})
</script>
